<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>扫码添加店主</title>
	<link rel="stylesheet" href="/layui/css/layui.css">
	<link rel="stylesheet" href="/css/HyqPublic.css">
	<link rel="stylesheet" href="/css/StoreCode.css">
  	<link rel="stylesheet" href="/fission/css/iconfont.css">
  	<link rel="stylesheet" href="/fission/css/common.css">
</head>

<style type="text/css">
  /*------------分页部分--------------*/
    .pageing-container-h{
      display: flex;
      justify-content: space-between;
      padding: 0px 20px 20px 20px;
    }
    .pageing-content-h{
      line-height: 28px;
    }
    .pageing-content-h a{
      border: 1px solid #e2e2e2;
      padding: 4px 15px;
      color: #333;
      line-height: 28px;
      border-radius: 2px;
    }
   .current{
     background: #1E9FFF !important;
     color: #fff !important;
   }
   .public_buttonSearch_container{
		display: flex;
		justify-content: space-between;
		align-items: center;
		background: #fff;
	}
	.public_buttonSearch_container a{
		color: #fff;
		background-color: #1E9FFF;
		text-shadow: 0 -1px 0 rgba(0,0,0,.12);
		height: 24px;
		padding: 4px 15px;
		font-size: 14px;
		border-radius: 2px;
		display: flex;
		align-items: center;
	}
	.public_Search_container{
		position: relative;
	}
	.public_Search_container input{
		width: 240px;
		height: 32px;
		border: 1px solid #d9d9d9;
	}
	.public_Search_container i{
		position: absolute;
		bottom: 6px;
		right: 10px;
		cursor: pointer;
	}
</style>
<body>
	<!-- 顶部导航 start -->
	<div class="StoreCode_headerNav_container">
		<ul class="StoreCode_headerNav_content">
			<li>
				<a href="index.html" class="StoreCode_headerNavActive">锁客二维码</a>
			</li>
			<li>
				<a href="statistics.html">数据统计</a>
			</li>
		</ul>
	</div>
	<!-- 顶部导航 end -->
	<!-- 主要内容区 -->
	<div class="StoreCode_main_container">
		<!-- 切换区门店列表页面 -->
		<div class="StoreCode_TabsStoreList_container">
			<div class="public_buttonSearch_container">
				<a href="add.html">+ 新建活码</a>
				<form  method="get" action="" id="Form1">
				<div class="public_Search_container">
					<input type="text" name="name" value="{$name}" required  lay-verify="required" placeholder="请输入渠道名称进行搜索" autocomplete="off" class="layui-input">
					<i class="layui-icon layui-icon-search" onclick="document.getElementById('Form1').submit()"></i>
				</div>
				</form>
			</div>
			<!-- table 区域 -->
			<div class="StoreCode_TabsStoreList_table_container">
				<table class="layui-table layui-form" lay-skin="line">
					<thead>
						<tr style="background: #fcfcfc;">
							<th>渠道名称</th>
							<th>扫码次数</th>
							<th>适用成员</th>
							<th>未达标成员</th>
							<th>创建时间</th>
							<th>操作</th>
						</tr> 
					</thead>
					<tbody>
						{loop $lockclient as $lock} 
						<tr>
							<td>{$lock["name"]}</td>
							<td>{$lock["counts"]}</td>
							<td style="width: 400px;">
								{loop  $lock["users"] as $users}
									<div class="service-card"><i class="iconfont icon-person"></i>{$this->get_users($users)}</div>
								{/loop}
							</td>
							<td style="width: 400px;">
								{loop  $lock["users_set"] as $users}
									<div class="service-card"><i class="iconfont icon-person"></i>{$this->get_users($users)}</div>
								{/loop}
							</td>
							<td>{$lock["ctime"]}</td>
							<td class="table-btn-container">
								<span onclick="share_lock({$lock['id']})">分享</span>
								<a href="upd-{$lock['id']}.html" class="table-btn">修改</a>
								<span onclick="del_lock({$lock['id']})">删除</span>
							</td>
						</tr>
						{/loop}
					</tbody>
				</table>
			</div>
			<div class="main-container-h pageing-container-h">
	        <div class="pageing-content-h">
	            <span>{$p->totalnum}条/{$p->totalpage}页</span>
	        </div>
          	<ul class="pageing-content-h">{P weidogsadmin}</ul>
         	</div>
		</div>
	</div>
	<script src="/cdn/jquery.min.js"></script>
	<script src="/layui/layui.all.js"></script>
	<script src="/js/ajax.js"></script>
	<script type="text/javascript">
		var form = layui.form;
		function share_lock(id){
			layer.open({
			  	type: 2,
			  	title: '分享',
			  	shadeClose: true,
			  	shade: 0.2,
			  	area: ['575px', '450px'],
			  	content: 'share_lock-'+id+'.html'
			}); 
		}

		function del_lock(id){
			myAjaxPost(false, true, 'del_lock.html', { id:id}, function (resp) {
				layer.msg(resp.msg);
				if(resp.status == "success"){
	              	setTimeout(function(){
	                	window.location.reload();
	              	},1000);
				}
			})
		}
	</script>
</body>
</html>